package com.ruoyi.system.api;

import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;

import java.util.List;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @GetMapping(value = "/user/info/{username}")
    public R<LoginUser> getUserInfo(@PathVariable("username") String username);
    /**
     * 通过用户id查询用户信息
     *
     * @param userid 用户名
     * @return 结果
     */
    @GetMapping(value = "/user/infoById/{userid}")
    public R<LoginUser> getUserInfoById(@PathVariable("userid") Long userid);
    /**
     * 获取用户列表
     *
     * @param user 用户
     * @return 结果
     */
    @GetMapping(value = "/user/list")
    public R<List<SysUser>> listNoPaging(SysUser user);
    /**
     * 获取当前用户信息
     *
     *
     * @return 结果
     */
    @GetMapping(value = "/user/profile/getUserInfo")
    public R<SysUser> getUserInfo();

    /**
     * 查询不同角色下的各个用户
     * @param roleKey
     * @return
     */
    @GetMapping(value = "/user/listNoPaging/{roleKey}")
    public R<List<SysUser>> listNoPagingRole(@PathVariable(value = "roleKey") String roleKey);
}
